/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jxl.Cell;
import jxl.NumberCell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import javax.swing.JOptionPane;

/**
 *
 * @author Mayara
 */
public class TabelaTransicao {

    private int matrix[][]; 

    public TabelaTransicao() {
        this.matrix = new int[58][98];
        povoa();
    }
    
    
    
    public void povoa()
    {
        Workbook workbook = null;
        try {
            workbook = Workbook.getWorkbook(new File("tabela.xls"));
        } catch (IOException ex) {
            Logger.getLogger(TabelaTransicao.class.getName()).log(Level.SEVERE, null, ex);
        } catch (BiffException ex) {
            Logger.getLogger(TabelaTransicao.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        Sheet sheet = workbook.getSheet(0);
        for(int i = 0; i < sheet.getRows(); i++)
        {
            for(int j = 0; j < sheet.getColumns(); j++)
            {
                Cell temp = sheet.getCell(j, i);
                int aux = Integer.parseInt(temp.getContents());
                matrix[i][j] = aux;
                //System.out.println(aux);
            }
        }
        
        /*for(int i = 0; i < sheet.getRows(); i++)
        {
            for(int j = 0; j < sheet.getColumns(); j++)
            {
                System.out.print(matrix[i][j] + "|");
            }
            System.out.println();
        }*/
    }

    public int[][] getMatrix() {
        return matrix;
    }
    
    
}
    
  

